package me.baicai.weixin.identity.repository;

import me.baicai.modules.belldandy.gcb.domain.FinancePayroll;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface FinancePayrollRepository extends JpaRepository<FinancePayroll, Long>
{
    List<Page> findAllByTargetd(String targe);

    @Transactional
    void deleteById(Integer id);

    @Transactional
    void deleteAllByTargetdAndName(String targe, String name);

    FinancePayroll findFinancePayrollById(Integer id);

    List<FinancePayroll> getAllByTargetd(String targe);

    List<FinancePayroll> findAllByName(String name);

    @Query(value = "select employeename from `user` where id = ?1", nativeQuery = true)
    String findUserName(Integer uid);

}
